package com.hcinfos.gsoo.json;

import java.util.List;

import org.codehaus.jackson.type.TypeReference;
import org.json.JSONObject;

import com.hcinfos.gsoo.enity.Area;
import com.hcinfos.gsoo.enity.Comment;
import com.hcinfos.gsoo.enity.ViewSuppDetail;
import com.hcinfos.gsoo.util.LogUtil;

public class CommentJson extends BaseJson {

	public static int total = 0;
	public static int state = -100;

	public static List<Comment> getCommentListByJson(String result)
			throws Exception {

		JSONObject obj = new JSONObject(result);
		String arrayStr = obj.getString("rows");
		state = obj.getInt("state");
		total = obj.getInt("total");
		List<Comment> list = objectMapper.readValue(arrayStr,
				new TypeReference<List<Comment>>() {
				});

		LogUtil.d("wxf", "size:" + list.size());
		return list;
	}
}
